package com.greenleaf.entity;

import java.util.Date;

import javax.annotation.Resource;

import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.stereotype.Component;

import com.fasterxml.jackson.annotation.JsonFormat;
/**
 * 商品表
 * */
@Component
public class Product {
private Integer pdtId;//编号
private String  pdtName;//商品名称
private double price;//价格
private Integer discount;//评级
private String pdtImg;//主图片
private String pdtTest;//商品详情
private Integer pdtClassId;//所属类别
@Resource
private PdtClass pdtClass;//所属类别
private String putaway;//是否上架
@JsonFormat(pattern = "yyyy-MM-dd HH:mm: ss",timezone="GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd")//存日期时使用
private Date dateTime;//上架日期
private Integer pdtWeight;//权重
public Product(Integer pdtId, String pdtName, double price, Integer discount, String pdtImg, String pdtTest,
		Integer pdtClassId, PdtClass pdtClass, String putaway, Date dateTime, Integer pdtWeight) {
	super();
	this.pdtId = pdtId;
	this.pdtName = pdtName;
	this.price = price;
	this.discount = discount;
	this.pdtImg = pdtImg;
	this.pdtTest = pdtTest;
	this.pdtClassId = pdtClassId;
	this.pdtClass = pdtClass;
	this.putaway = putaway;
	this.dateTime = dateTime;
	this.pdtWeight = pdtWeight;
}
public PdtClass getPdtClass() {
	return pdtClass;
}
public void setPdtClass(PdtClass pdtClass) {
	this.pdtClass = pdtClass;
}
public Integer getPdtId() {
	return pdtId;
}
public void setPdtId(Integer pdtId) {
	this.pdtId = pdtId;
}
public String getPdtName() {
	return pdtName;
}
public void setPdtName(String pdtName) {
	this.pdtName = pdtName;
}
public double getPrice() {
	return price;
}
public void setPrice(double price) {
	this.price = price;
}
public Integer getDiscount() {
	return discount;
}
public void setDiscount(Integer discount) {
	this.discount = discount;
}
public String getPdtImg() {
	return pdtImg;
}
public void setPdtImg(String pdtImg) {
	this.pdtImg = pdtImg;
}
public String getPdtTest() {
	return pdtTest;
}
public void setPdtTest(String pdtTest) {
	this.pdtTest = pdtTest;
}
public Integer getPdtClassId() {
	return pdtClassId;
}
public void setPdtClassId(Integer pdtClassId) {
	this.pdtClassId = pdtClassId;
}
public String getPutaway() {
	return putaway;
}
public void setPutaway(String putaway) {
	this.putaway = putaway;
}
public Date getDateTime() {
	return dateTime;
}
public void setDateTime(Date dateTime) {
	this.dateTime = dateTime;
}
public Integer getPdtWeight() {
	return pdtWeight;
}
public void setPdtWeight(Integer pdtWeight) {
	this.pdtWeight = pdtWeight;
}
public Product(Integer pdtId, String pdtName, double price, Integer discount, String pdtImg, String pdtTest,
		Integer pdtClassId, String putaway, Date dateTime, Integer pdtWeight) {
	super();
	this.pdtId = pdtId;
	this.pdtName = pdtName;
	this.price = price;
	this.discount = discount;
	this.pdtImg = pdtImg;
	this.pdtTest = pdtTest;
	this.pdtClassId = pdtClassId;
	this.putaway = putaway;
	this.dateTime = dateTime;
	this.pdtWeight = pdtWeight;
}
public Product() {
	super();
}

@Override
public String toString() {
	return "Product [pdtId=" + pdtId + ", pdtName=" + pdtName + ", price=" + price + ", discount=" + discount
			+ ", pdtImg=" + pdtImg + ", pdtTest=" + pdtTest + ", pdtClassId=" + pdtClassId + ", pdtClass=" + pdtClass
			+ ", putaway=" + putaway + ", dateTime=" + dateTime + ", pdtWeight=" + pdtWeight + "]";
}


}
